/**
 * User: Anton Petrov
 * Date: 3/10/13
 * Time: 8:33 PM
 */
package com.antonpetrov.util
{
	import mx.utils.ObjectUtil;

	import org.flexunit.assertThat;

	public class TestUtil
	{
		public static function assertEqualArrays(
			arrayOne:Array, arrayTwo:Array):Boolean
		{
			if (arrayOne == null && arrayTwo == null)
			{
				return true;
			}

			if (arrayOne == null || arrayTwo == null)
			{
				return false;
			}

			if (arrayOne.length != arrayTwo.length)
			{
				return false;
			}

			var areEqual:Boolean = true;

			for (var i:int = 0; i < arrayOne.length; ++i)
			{
				areEqual =
					areEqual && (ObjectUtil.compare(arrayOne[i], arrayTwo[i]) == 0);
			}

			return areEqual;
		}
	}
}
